"use strict";
const common_vendor = require("../../../../../common/vendor.js");
if (!Array) {
  const _easycom_up_text2 = common_vendor.resolveComponent("up-text");
  _easycom_up_text2();
}
const _easycom_up_text = () => "../../../../../node-modules/uview-plus/components/u-text/u-text.js";
if (!Math) {
  (_easycom_up_text + AnomalyStatistics)();
}
const AnomalyStatistics = () => "./anomalyStatistics/index.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    const user = common_vendor.ref({
      date: "2024-05-21",
      time: "12:53",
      SBP: 158,
      DBP: 120,
      HR: 83,
      risklevel: {
        nomal: 1,
        low: 1,
        light: 2,
        middle: 1,
        high: 2,
        get all() {
          return this.nomal + this.low + this.light + this.middle + this.high;
        }
      }
    });
    const entries = common_vendor.ref([
      { time: "08: 00", medicine: "阿莫西林", dosage: "2粒", taken: true, status: "已服用" },
      { time: "12: 00", medicine: "阿莫西林", dosage: "2粒", taken: false, status: "未服用" },
      { time: "18: 00", medicine: "阿莫西林", dosage: "2粒", taken: false, status: "未服用" }
    ]);
    const toggleTaken = (index) => {
      entries.value[index].taken = !entries.value[index].taken;
      entries.value[index].status = entries.value[index].taken ? "已服用" : "未服用";
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.p({
          text: `${user.value.date} ${user.value.time}`
        }),
        b: common_vendor.p({
          text: "查看更多记录",
          align: "right"
        }),
        c: common_vendor.p({
          text: user.value.SBP,
          bold: "true",
          align: "center"
        }),
        d: common_vendor.p({
          text: "收缩压",
          align: "center"
        }),
        e: common_vendor.p({
          text: "（mmHg）",
          align: "center"
        }),
        f: common_vendor.p({
          text: user.value.DBP,
          bold: "true",
          align: "center"
        }),
        g: common_vendor.p({
          text: "舒张压",
          align: "center"
        }),
        h: common_vendor.p({
          text: "（mmHg）",
          align: "center"
        }),
        i: common_vendor.p({
          text: user.value.HR,
          bold: "true",
          align: "center"
        }),
        j: common_vendor.p({
          text: "心率",
          align: "center"
        }),
        k: common_vendor.p({
          text: "（次/分钟）",
          align: "center"
        }),
        l: common_vendor.p({
          text: "风险评估：",
          align: "center"
        }),
        m: common_vendor.p({
          text: "重度",
          bold: "true",
          align: "left"
        }),
        n: common_vendor.p({
          text: "最近7天异常血压统计"
        }),
        o: common_vendor.p({
          text: "6/21-6/27",
          align: "right"
        }),
        p: common_vendor.p({
          text: "高度",
          bold: "true",
          align: "center"
        }),
        q: common_vendor.p({
          text: `${user.value.risklevel.high}次`,
          align: "center"
        }),
        r: common_vendor.p({
          text: "正常高值",
          align: "center",
          bold: "true"
        }),
        s: common_vendor.p({
          text: `${user.value.risklevel.nomal}次`,
          align: "center"
        }),
        t: common_vendor.p({
          text: "中度",
          align: "center",
          bold: "true"
        }),
        v: common_vendor.p({
          text: `${user.value.risklevel.middle}次`,
          align: "center"
        }),
        w: common_vendor.p({
          text: "偏低",
          align: "center",
          bold: "true"
        }),
        x: common_vendor.p({
          text: `${user.value.risklevel.low}次`,
          align: "center"
        }),
        y: common_vendor.p({
          text: "轻度",
          align: "center",
          bold: "true"
        }),
        z: common_vendor.p({
          text: `${user.value.risklevel.light}次`,
          align: "center"
        }),
        A: common_vendor.p({
          text: "总计",
          align: "center",
          bold: "true"
        }),
        B: common_vendor.p({
          text: `${user.value.risklevel.all}次`,
          align: "center"
        }),
        C: common_vendor.p({
          text: "2024-05-21 用药管理",
          align: "left"
        }),
        D: common_vendor.p({
          text: "进入管理",
          align: "right"
        }),
        E: common_vendor.f(entries.value, (entry, index, i0) => {
          return {
            a: entry.taken ? 1 : "",
            b: "5bb2718e-30-" + i0,
            c: common_vendor.p({
              text: entry.time,
              align: "left"
            }),
            d: entry.taken,
            e: common_vendor.o(($event) => toggleTaken(index), index),
            f: "5bb2718e-31-" + i0,
            g: common_vendor.p({
              text: entry.medicine
            }),
            h: "5bb2718e-32-" + i0,
            i: common_vendor.p({
              text: entry.dosage
            }),
            j: common_vendor.n(entry.taken ? "taken" : "not-taken"),
            k: "5bb2718e-33-" + i0,
            l: common_vendor.p({
              text: entry.status,
              align: "center"
            }),
            m: index
          };
        })
      };
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5bb2718e"]]);
wx.createComponent(Component);
